<?php
namespace app\home\controller;

use \thin\Validate as Validate;
class Essay extends Home {
    public function work(){
        if($this->req->has('id')){
            $id = $this->req->get('id');
            $model = new \app\home\model\PaperEssay;
            $data = $model->where(['pap_id'=>$id])->select();

            $model = new \app\home\model\Paper;
            $paper = $model->get($id);
            $this->assign('paper',$paper);
            $this->assign('data',$data);
            return $this->fetch();
        }else{
            return;
        }
        
    }
}
